﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PServiceBus.Core.Interface {
    /// <summary>
    /// Interface for implement a class that auto generate message handler based on specified transport
    /// </summary>
    public interface ITransportHandler<TTransport> where TTransport : ITransport {
        /// <summary>
        /// Generate a message handler for the specified transport to read messages in the specific TMessage type
        /// </summary>
        /// <typeparam name="TMessage"></typeparam>
        /// <param name="transport"></param>
        /// <returns></returns>
        IMessageHandler<TMessage> CreateHandler<TMessage>(TTransport transport) where TMessage : class;
        /// <summary>
        /// How often to poll for new data
        /// </summary>
        TimeSpan Interval { get; set; }
        /// <summary>
        /// How much data to pull every time data is fetch
        /// </summary>
        int BatchSize { get; set; }
    }
}
